<div class="Dvutsinhviens index">
<?php if(!empty($dvutsinhviens)):?>        
	<h2><?php __('Danh sách đoàn viên ưu tú đã được bình xét');?></h2>
    <h2><?php __('Chi đoàn: '.$chidoan['Chidoansv']['tenchidoan'].' ('.$chidoan['Chidoansv']['machidoansv'].')');?></h2>
	<?php echo "Năm học: ".$dvutsinhviens[0]['Z1dvutsinhvien']['namhoc']; ?>
    <?php echo $this->Form->create('Dvutsinhvien',array('action'=>'duyet'));?>
    <?php echo $this->Form->input('chidoan_id',array('type'=>'hidden','value'=>$chidoan['Chidoansv']['id']));?>
	<table cellpadding="0" cellspacing="0">
	<tr>
            <th><?php __('STT');?></th>
            <th>
                <?php 
                echo $this->Form->checkbox('all',array('id'=>'checkallduyet')) ;
                __('Đã Duyệt');
                ?>
            </th>
            <th>
                <?php 
                echo $this->Form->checkbox('all',array('id'=>'checkallchuaduyet')) ;
                __('Chưa duyệt');
                ?>
            </th>
			<th><?php __('MSSV');?></th>
            <th><?php __('Họ tên');?></th>
			<th><?php __('Số người đồng ý');?></th>
			<th><?php __('Ghi chú');?></th>            
            <th><?php __('Action');?></th>
	</tr>
	<?php
	$i = 0;
    $j=1;
	foreach ($dvutsinhviens as $dvutsinhvien):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
        <td>
            <?php echo $i ;?>
        </td>
        <td><?php if($dvutsinhvien['Z1dvutsinhvien']['duyet']==0) echo $this->Form->checkbox('Dvutsinhvien.duyet.'.$dvutsinhvien['Z1dvutsinhvien']['id'],array('class'=>'duyet')); else echo "Đã duyệt";?></td>
        <td><?php if($dvutsinhvien['Z1dvutsinhvien']['duyet']==1) echo $this->Form->checkbox('Dvutsinhvien.chuaduyet.'.$dvutsinhvien['Z1dvutsinhvien']['id'],array('class'=>'chuaduyet')); else echo "Chưa duyệt";?></td>
        <td>
            <?php echo $dvutsinhvien['Z1dvutsinhvien']['mssv'];?>
        </td>
        <td>
            <?php echo $dvutsinhvien['Z1dvutsinhvien']['hoten'];?>
        </td>
		<td><?php echo $dvutsinhvien['Z1dvutsinhvien']['songuoidongy'].'/'.$dvutsinhvien['Z1dvutsinhvien']['songuoithamgiabau'];?>&nbsp;</td>
        <td>
            <?php echo $dvutsinhvien['Z1dvutsinhvien']['ghichu'];?>
        </td>
        <td class="actions">        
            <?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $dvutsinhvien['Z1dvutsinhvien']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $dvutsinhvien['Z1dvutsinhvien']['mssv'])); ?>
		</td>		
	</tr>
    <?php $j++;?>
<?php endforeach; ?>
	</table>
     <?php
     echo $this->Form->end('Lưu');
    ?>
<?php else:?>
    <?php echo "Chưa bình xét đoàn viên ưu tú!";?>
<?php endif;?>        
</div>
